<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ECSHOP 管理中心 - <?php echo ($meta_title); ?> </title>
    <meta name="robots" content="noindex, nofollow">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="/Public/css/general.css" rel="stylesheet" type="text/css"/>
    <link href="/Public/css/main.css" rel="stylesheet" type="text/css"/>
    <script src="/Public/js/jquery-1.11.3.js"></script>

    
    <link rel="stylesheet" type="text/css" href="/Public/css/page.css" />

    
</head>
<body>

    <h1>
        <span class="action-span"><a href="<?php echo U('add');?>">添加新商品</a></span>
        <span class="action-span1"><a href="<?php echo U('Index/main');?>">ECSHOP 管理中心</a></span>
        <span id="search_id" class="action-span1"> - <?php echo ($meta_title); ?> </span>
        <div style="clear:both"></div>
    </h1>
    <div class="form-div">
        <form action="" name="searchForm">
            <img src="/Public/img/icon_search.gif" width="26" height="22" border="0" alt="search" />
            <!-- 分类 -->
            <?php echo onearr2select($goodsCategory,'cat_id','所有分类');?>
            <!-- 品牌 -->
            <?php echo onearr2select($brand,'brand_id','所有品牌');?>
            <!-- 推荐 -->
            <?php echo onearr2select($goods_status,'goods_status','所有推荐');?>
            <!-- 上架 -->
            <?php echo onearr2select($is_on_sales,'is_on_sale','售卖状态');?>
            <!-- 关键字 -->
            关键字 <input type="text" name="keyword" size="15" />
            <input type="submit" value=" 搜索 " class="button" />
        </form>
    </div>

    <!-- 商品列表 -->
    <form method="post" action="" name="listForm" onsubmit="">
        <div class="list-div" id="listDiv">
            <table cellpadding="3" cellspacing="1">
                <tr>
                    <th>编号</th>
                    <th>商品名称</th>
                    <th>分类</th>
                    <th>供货商</th>
                    <th>品牌</th>
                    <th>货号</th>
                    <th>价格</th>
                    <th>上架</th>
                    <th>精品</th>
                    <th>新品</th>
                    <th>热销</th>
                    <th>推荐排序</th>
                    <th>库存</th>
                    <th>操作</th>
                </tr>
                <?php if(is_array($rows)): foreach($rows as $key=>$row): ?><tr>
                        <td align="center"><?php echo ($row["id"]); ?></td>
                        <td align="center" class="first-cell"><span><?php echo ($row["name"]); ?></span></td>
                        <td align="center"><span onclick=""><?php echo ($goodsCategory[$row[goods_category_id]]); ?></span></td>
                         <td align="center"><span onclick=""><?php echo ($brand[$row[brand_id]]); ?></span></td>
                          <td align="center"><span onclick=""><?php echo ($supplier[$row[supplier_id]]); ?></span></td>
                           <td align="center"><span onclick=""><?php echo ($row["sn"]); ?></span></td>
                        <td align="center"><span><?php echo ($row["shop_price"]); ?></span></td>
                        <td align="center"><img src="/Public/img/<?php echo ($row["is_on_sale"]); ?>.gif"/></td>
                        <td align="center"><img src="/Public/img/<?php echo ($row["is_best"]); ?>.gif"/></td>
                        <td align="center"><img src="/Public/img/<?php echo ($row["is_new"]); ?>.gif"/></td>
                        <td align="center"><img src="/Public/img/<?php echo ($row["is_hot"]); ?>.gif"/></td>
                        <td align="center"><?php echo ($row["sort"]); ?></td>
                        <td align="center"><?php echo ($row["stock"]); ?></td>
                        <td align="center">
                            <a href="<?php echo U('edit',array('id'=>$row['id']));?>" title="编辑"><img src="/Public/img/icon_edit.gif" width="16" height="16" border="0" /></a>
                            <a href="<?php echo U('delete',array('id'=>$row['id']));?>" onclick="" title="回收站"><img src="/Public/img/icon_trash.gif" width="16" height="16" border="0" /></a></td>
                    </tr><?php endforeach; endif; ?>
            </table>

            <!-- 分页开始 -->
            <div class='page'>
                <?php echo ($page_html); ?>
            </div>
            <!-- 分页结束 -->
        </div>
    </form>

<div id="footer">
    共执行 <?php echo N('db_query');?> 个查询，用时 <?php echo G('loadTime','initTime');?> 秒，Gzip 已禁用，内存占用 <?php echo number_format((memory_get_usage() - $GLOBALS['_startUseMems'])/1024);?> KB<br/>
    版权所有 &copy; 重庆京西商城，并保留所有权利。
</div>
</body>
</html>